package net.xo68.destiny.manager.service;

import lombok.extern.slf4j.Slf4j;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.xo68.destiny.manager.entity.JobDetail;
import net.xo68.destiny.manager.mapper.JobDetailMapper;



/** 
 * JobDetail Service
 * @author wuxie(16349023@qq.com)
 * @date 2020年12月21日 21:43:52
 *
 */
@Slf4j
@Service
public class JobDetailService{
    
    @Autowired
    private JobDetailMapper jobDetailMapper;

    public JobDetail find(Long jobId) {
        return  jobDetailMapper.find(jobId);
    }

    public JobDetail insert(JobDetail jobDetail) {
        jobDetailMapper.insert(jobDetail);
        return jobDetail;
    }

    public JobDetail update(JobDetail jobDetail) {
        jobDetailMapper.update(jobDetail);
        return jobDetail;
    }
    
    public int delete(Long jobId) {
        return jobDetailMapper.delete(jobId);
    }
    
    public List<JobDetail> list() {
        return jobDetailMapper.list();
    }
	
	public PageInfo<JobDetail> list(int pageNumber,int pageSize) {
        PageHelper.startPage(pageNumber, pageSize,true);
        List<JobDetail> docs = jobDetailMapper.list();
        PageInfo<JobDetail> pageInfo = new PageInfo<JobDetail>(docs);
        return pageInfo;
    }
}